package com.taoym.voucher.xcx.controller;

import com.taoym.voucher.common.response.Response;
import com.taoym.voucher.xcx.entity.dto.XcxAddClickRecordDTO;
import com.taoym.voucher.xcx.service.XcxClickRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @coder taoym
 * @datetime 2021/8/19 17:05
 * @desc
 */
@RestController
@RequestMapping("/click/record")
@Api(tags = "领券点击记录控制器")
@Validated
public class XcxClickRecordController {

    @Autowired
    private XcxClickRecordService xcxClickRecordService;

    @PostMapping("/add")
    @ApiOperation("添加点击记录")
    public Response<Integer> addClickRecord(@RequestBody @Valid XcxAddClickRecordDTO data) {
        return Response.success(xcxClickRecordService.addClickRecord(data));
    }
}
